package com.controller.qd;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.common.ajax.AjaxRes;
import com.common.mybatis.Page;
import com.common.utils.base.UuidUtil;
import com.controller.base.BaseController;
import com.entity.AppendixRelationship;
import com.entity.ComplaintProposal;
import com.entity.Information;
import com.service.ComplaintProposalService;
import com.service.informationService;

@Controller
@RequestMapping("/jianyi/")
public class JianyiController extends BaseController<Object>{

	@Autowired
	private ComplaintProposalService cpservice;
	/**
	 * 分页查询
	 * @return
	 */
	@RequestMapping("/insert")
	@ResponseBody
	public AjaxRes insert(ComplaintProposal cp){
		AjaxRes res=new AjaxRes(); 
		cp.setId(UuidUtil.get32UUID());
		cp.setComplaintTime(new Date());
		cp.setComplaintState("正常");
		//用于测试是否添加成功的变量
		Integer a =cpservice.insert(cp);
		if(a==0){
			res.setResMsg("添加失败");
		}else{
			res.setResMsg("添加成功");
		}
		return res;
	}
}
